public function disableInternetConnection()
 {
     ////since at id 10001 in table advance settings have the parameter for the internet connectios
     AdvanceSettings::model()->updateByPk(10001, array('value' => '0'));
 }
?>
	 </td>
	</tr>
	
	<tr>
		<td colspan="2">
		<?php 
//$send_order_url=Yii::app()->request->baseUrl.'/PurchaseOrder/SendOrder/'.$purchase_id;
//$send_order_url=Yii::app()->request->baseUrl.'/index.php?r=purchaseOrder/SendOrder&id='.$purchase_id;
$send_order_url = $this->createUrl('purchaseOrder/sendOrder', array('id' => $purchase_id));
?>

		
		<?php 
$setupModel = Setup::model()->findByPk(1);
$internet_connected = AdvanceSettings::model()->findByAttributes(array('parameter' => 'internet_connected'));
$current_url = Yii::app()->request->url;
if ($internet_connected->value == 1) {
    if (Setup::model()->checkInternet()) {
        if ($model->order_status < 3) {
            ?>
			<a href="<?php 
            echo $send_order_url;
            ?>
" onclick="return confirm('Are you sure?')"> 
			<?php 
            echo CHtml::button($model->order_status == 1 ? 'Send Order' : 'Resend Order');
            ?>
		 	</a>
		 	<br>
			<small>Ordered will be send via email. Please make sure your mail settings are configured</small>	
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = AdvanceSettings::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }